package com.tseacher.service.impl;

import com.tseacher.dao.UserDao;
import com.tseacher.pojo.User;
import com.tseacher.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;

    @Override
    public void addUser(User user) {
        //1、查询该user的email是否已经注册
        if(userDao.selectUser(user.getEmail())==null){
            userDao.add(user);
        }
    }

    @Override
    public User selectUser(String email) {
        return userDao.selectUser(email);
    }
}
